﻿requirejs.config({
    baseUrl: ".",
    paths: {
    	zepto:"javascripts/zepto.min",
    	dingtalk:"javascripts/dingtalk",
        vue: "components/vue/vue.min",
        axios: "components/axios/axios.min",
        MINT: "components/mint-ui/index",
        common: "resources/js/common"
    },
    shim: {
        "MINT": {
            deps: ["vue"],
            exports: "MINT"
        }
    }
});

require(["zepto","dingtalk","vue", "axios", "MINT", "common"], function (zepto,dingtalk,Vue, axios, MINT, common) {

    Vue.component(MINT.Navbar.name, MINT.Navbar);
    Vue.component(MINT.TabItem.name, MINT.TabItem);
    Vue.component(MINT.TabContainer.name, MINT.TabContainer);
    Vue.component(MINT.TabContainerItem.name, MINT.TabContainerItem);

    var vm = new Vue({
        el: "#view",
        data: {
            selected: "info",
            detail: {},
            failureResume: [],
            changeResume: []
        },
        mounted: function () {
            var self = this;

            var id = common.getParam("id");
            axios.get("equipment/detail?id=" + id)
                .then(function (response) {
                    self.detail = response.data;
                });

            axios.get("equipment/failureResume?id=" + id)
                .then(function (response) {
                    self.failureResume = response.data;
                });

            axios.get("equipment/changeResume?id=" + id)
                .then(function (response) {
                    self.changeResume = response.data;
                });
        },
        methods: {
        }
    });
});